#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int get_days_of_month(int x, int y)
{
	int days[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
	int day = days[y];
	

}




int main()
{
	int year = 0;
	int month = 0;
	int days = 0;

	scanf("%d  %d", &year, &month);
	days = get_days_of_month(year,month);
	printf("%d", days);

	return 0;
}